package com.codejiwei.flink.practice;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author jiwei
 * @description
 * @date 2023/5/23 15:51
 */
public class Flink_WaterMark_Monotonous {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(10);
//        env.socketTextStream("localhost", 8889)
//                .flatMap((String line, Collector<Tuple2<String, Long>> out) -> {
//                    Arrays.stream(line.split("\\W+")).forEach(word -> out.collect(Tuple2.of(word, 1L)));
//                })
//                .returns(Types.TUPLE(Types.STRING, Types.LONG))
//                .keyBy(t -> t.f0)
//                .window(TumblingEventTimeWindows.of(Time.seconds(10)))
//                .

        env.execute();

    }
}
